import axios from 'axios'

// 站点分类接口
export function getCategoryList(params) {
    return axios.get('/site/category/list', { params })
}

export function getAllCategories() {
    return axios.get('/site/category/all')
}

export function addCategory(data) {
    return axios.post('/site/category', data)
}

export function updateCategory(data) {
    return axios.put('/site/category', data)
}

export function deleteCategory(id) {
    return axios.delete(`/site/category/${id}`)
}

export function updateCategorySort(data) {
    return axios.put('/site/category/sort', data)
}

// 站点接口
export function getSiteList(params) {
    return axios.get('/site/list', { params })
}

export function getSitesByCategory(categoryId) {
    return axios.get(`/site/category/${categoryId}`)
}

export function getRecommendSites() {
    return axios.get('/site/recommend')
}

export function addSite(data) {
    return axios.post('/site', data)
}

export function updateSite(data) {
    return axios.put('/site', data)
}

export function deleteSite(id) {
    return axios.delete(`/site/${id}`)
}

export function updateSiteSort(data) {
    return axios.put('/site/sort', data)
}

export function updateSiteRecommend(id, status) {
    return axios.put(`/site/${id}/recommend/${status}`)
}

// 导入收藏夹接口
export function importBookmarks(data) {
    return axios.post('/site/import-bookmarks', data, {
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
} 